
SELECT FORMMAIN_1678.FIELD0002 memberCode,FORMMAIN_1678.FIELD0003 memberName,ORG_UNIT."ID" deptId, 
CASE WHEN ORG_POST."ID" IS NULL THEN NULL ELSE ORG_POST."ID" END postId,PERSON_SECRET_LEVELS.PSL_ID
FROM FORMMAIN_1678
LEFT JOIN ORG_MEMBER ON ORG_MEMBER.CODE = FORMMAIN_1678.FIELD0002 AND ORG_MEMBER.IS_DELETED = 0   
LEFT JOIN ORG_UNIT ON ORG_UNIT.CODE = FORMMAIN_1678.FIELD0006 AND ORG_UNIT.IS_DELETED = 0
LEFT JOIN ORG_POST ON ORG_POST.CODE = FORMMAIN_1678.FIELD0007 AND ORG_POST.IS_DELETED = 0
LEFT JOIN PERSON_SECRET_LEVELS ON PERSON_SECRET_LEVELS.PSL_NAME = FORMMAIN_1678.FIELD0004
WHERE ORG_MEMBER.CODE IS NULL AND FORMMAIN_1678.FIELD0005 = 2 AND FORMMAIN_1678.FIELD0006 != '13' AND FORMMAIN_1678.FIELD0006 != '14'